package com.example.tms.entity;

import lombok.Data;
import lombok.Getter;
import org.springframework.data.neo4j.core.schema.*;
import org.springframework.data.neo4j.core.schema.Property;
import java.util.List;
import java.util.Set;
import static org.springframework.data.neo4j.core.schema.Relationship.Direction.*;

@Node("Employee")
@Data
public class EmployeeNode {
    @Getter
    @Id
    private String id;
    @Getter
    @Property
    private String name;

    public void setId(String id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    @Relationship(type = "MANAGES", direction = OUTGOING)
    private List<EmployeeNode> subordinates;

    @Relationship(type = "COLLEAGUE")
    private Set<EmployeeNode> colleagues;

    @Relationship(type = "PARTICIPATED_IN", direction = OUTGOING)
    private Set<ProjectNode> projects;

    public List<EmployeeNode> getSubordinates() {
        return subordinates;
    }

    public void setSubordinates(List<EmployeeNode> subordinates) {
        this.subordinates = subordinates;
    }

    public Set<EmployeeNode> getColleagues() {
        return colleagues;
    }

    public void setColleagues(Set<EmployeeNode> colleagues) {
        this.colleagues = colleagues;
    }

    public Set<ProjectNode> getProjects() {
        return projects;
    }

    public void setProjects(Set<ProjectNode> projects) {
        this.projects = projects;
    }
}
